package com.tofindaway.jms;

import java.util.Scanner;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class testSend {
	private static ApplicationContext ctx;

	public static void main(String[] args) throws InterruptedException {
		ctx = new ClassPathXmlApplicationContext("application-context.xml");
		JmsSender messageSender = (JmsSender) ctx.getBean("messageSender");
		while (true) {
			Scanner scanner = new Scanner(System.in);
			System.out.println("enter title");
			String title = scanner.nextLine();
			System.out.println("enter message boy");
			String body = scanner.nextLine();
			messageSender.sendTextMsg(new MyMsg(title, body));
			Thread.sleep(2000);
		}
	}
}